package work20241203_chap6oop.b_extends;

/**
 * @author zdl
 * @date 2024/12/3
 */
public class Father {
    String name;
    private String hobby;

    public Father() {
        this("天天","打麻将");
        System.out.println("Father类无参构造方法");
    }

    public Father(String name, String hobby) {
        this.name = name;
        this.hobby = hobby;
        System.out.println("Father类you参构造方法");
    }

    public void eat(){
        System.out.println("吃面条");
    }

    public String getHobby() {
        return hobby;
    }

    public void setHobby(String hobby) {
        this.hobby = hobby;
    }
}
